// pages/category/category.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
    scrollHeigth: 667,
    conId: 0, //默认选项
    categoryItem: [
      "奥迪",
      "奔驰",
      "宝马",
      "大众",
      "东风风光",
      "别克",
      "吉利",
      "铃木",
    ],
    content: [
      [{
          "img": "../../image/aoudi1.jpg",
          "name": "e-tron ",
          'car': '奥迪'
        },
        {
          "img": "../../image/aoudi2.jpg",
          "name": "A3 Limousine"
        },
        {
          "img": "../../image/aoudi3.jpg",
          "name": "A3 Sportback"
        },
        {
          "img": "../../image/aoudi4.jpg",
          "name": "A4L"
        },
        {
          "img": "../../image/aoudi5.jpg",
          "name": "A6L",
        },
        {
          "img": "../../image/aoudi6.jpg",
          "name": "Q3"
        }
      ],
      [{
          "img": "../../image/benci1.jpg",
          "name": "E级 PHEV",
          'car': '奔驰'
        },
        {
          "img": "../../image/benci2.jpg",
          "name": "A级三厢"
        },
        {
          "img": "../../image/benci3.jpg",
          "name": "E级"
        },
        {
          "img": "../../image/benci4.jpg",
          "name": "GLA级"
        },
        {
          "img": "../../image/benci5.jpg",
          "name": "GLB级"
        },
      ],
      [{
          "img": "../../image/baoma1.jpg",
          "name": "1系三厢",
          'car': '宝马'
        },
        {
          "img": "../../image/baoma2.jpg",
          "name": "X2"
        },
        {
          "img": "../../image/baoma3.jpg",
          "name": "3系"
        },
        {
          "img": "../../image/baoma4.jpg",
          "name": "5系"
        },
        {
          "img": "../../image/baoma5.jpg",
          "name": "2系旅行车"
        },
      ],
      [{
          "img": "../../image/dazong1.jpg",
          "name": "帕萨特",
          'car': '大众'
        },
        {
          "img": "../../image/dazong2.jpg",
          "name": "途昂X"
        },
        {
          "img": "../../image/dazong3.jpg",
          "name": "途观L"
        },
        {
          "img": "../../image/dazong4.jpg",
          "name": "途岳"
        },
        {
          "img": "../../image/dazong5.jpg",
          "name": "新桑塔纳"
        },
        {
          "img": "../../image/dazong6.jpg",
          "name": "Cross Polo"
        },
      ],
      [{
          "img": "../../image/donfen1.jpg",
          "name": "风光S560",
          'car': '东风风光'
        },
        {
          "img": "../../image/donfen2.jpg",
          "name": "风光500"
        },
        {
          "img": "../../image/donfen3.jpg",
          "name": "风光580"
        },
        {
          "img": "../../image/donfen4.jpg",
          "name": "风光E1"
        },
        {
          "img": "../../image/donfen5.jpg",
          "name": "风光ix5"
        },
        {
          "img": "../../image/donfen6.jpg",
          "name": "风光580混动"
        },
      ],
      [{
          "img": "../../image/bieke1.jpg",
          "name": "昂科旗",
          'car': '别克'
        },
        {
          "img": "../../image/bieke2.jpg",
          "name": "君威"
        },
        {
          "img": "../../image/bieke3.jpg",
          "name": "君越"
        },
        {
          "img": "../../image/bieke4.jpg",
          "name": "GL8Avenir"
        },
        {
          "img": "../../image/bieke5.jpg",
          "name": "君威混合动力"
        },
        {
          "img": "../../image/bieke6.jpg",
          "name": "林荫大道"
        },
      ],
      [{
        "img": "../../image/jili1.jpg",
        "name": "新帝豪",
        'car': '吉利'
      },
      {
        "img": "../../image/jili2.jpg",
        "name": "帝豪GS"
      },
      {
        "img": "../../image/jili3.jpg",
        "name": "缤越"
      },
      {
        "img": "../../image/jili4.jpg",
        "name": "帝豪GSe"
      },
      {
        "img": "../../image/jili5.jpg",
        "name": "金刚CROSS"
      },
      {
        "img": "../../image/jili6.jpg",
        "name": "经典版帝豪"
      },
    ],
    [{
      "img": "../../image/linmu1.jpg",
      "name": "利亚纳A6两厢",
      'car': '铃木'
    },
    {
      "img": "../../image/linmu2.jpg",
      "name": "北斗星e+"
    },
    {
      "img": "../../image/linmu3.jpg",
      "name": "昌铃王"
    },
    {
      "img": "../../image/linmu4.jpg",
      "name": "利亚纳两厢"
    },
    {
      "img": "../../image/linmu5.jpg",
      "name": "雨燕"
    },
    {
      "img": "../../image/linmu6.jpg",
      "name": "奥拓"
    },
  ],
    ]
  },

  setId(options) {
    let id = options.target.dataset.id;
    // 修改data数据
    this.setData({
      conId: id
    })
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    // 页面初始化只加载一次

    wx.getSystemInfo({
      success: (result) => {
        // 返回数据到视图 页面
        this.setData({
          scrollHeigth: result.windowHeight
        })
      },
    })


  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {
    // 页面初次渲染加载一次

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {
    // 底部导航切换显示

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {
    // 底部导航切换隐藏

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {},

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {

  }
})